home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
18
/
fpc103.zip
/
COMMENT.SEQ
< prev
next >
Wrap
Text File
|
1988-02-01
|
3KB
|
73 lines
\ COMMENT.SEQ Allow multiple line comments in files. by Tom Zimmer
: ?exec ( --- )
state @ abort" Can not be used while Compiling!" ;
: <comment:> ( --- )
loading @ 0= abort" COMMENT: can ONLY be used while loading"
bl word 1+ " comment;" caps-comp 0=
if ['] <run> is run
then [compile] \ ;
: comment: ( --- ) \ ignore all lines between.
[compile] \
['] <comment:> is run ;
: <.comment:> ( --- )
loading @ 0= abort" .COMMENT: can ONLY be used while loading"
bl word 1+ " comment;" caps-comp 0=
if ['] <run> is run
else key? 0=
if cr tib span @ 78 min type
then
then [compile] \ ;
: .comment: ( --- ) \ ignore all lines between.
[compile] \
['] <.comment:> is run ;
comment: <- this marks the start line of a multi line comment.
this is a comment line somewhere in the middle.
comment; <- this marks the end line of a multi line comment.
defer prevrun
: <#if> ( --- ) \ ignore lines unless #else, or #endif
begin bl word dup c@ 0= >r 1+
dup " #endif" caps-comp 0= over
" #then" caps-comp 0= or swap
" #else" caps-comp 0= or dup
if @> prevrun is run
>r prevrun r>
then r> or
until ;
: #else ( --- )
?exec
@> run is prevrun \ Save previous value of RUN.
['] <#if> is run \ Ignore following lines
<#if> ; immediate \ and rest of this line.
: #if ( f1 --- ) \ ignore lines following if false
?exec
0=
if @> run is prevrun \ Save previous value of RUN.
['] <#if> is run \ Ignore following lines
<#if> \ and rest of this line.
then ; immediate
: #endif ; immediate \ just a noop for the #if TRUE case.
: #then ; immediate
\s ************* NOT LOADING BEYOND THIS LINE ***********
\ Here is an example of how the interpreted compiler directives
\ work
cr cr .( press a T for true ) key bl or 116 = \ wait for a key
#if .( TRUE) #else .( FALSE) #then .( always )